﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AdminCP/Layouts/Admin.Master" AutoEventWireup="true"
    CodeBehind="StockMananger.aspx.cs" Inherits="MLM.AdminCP.Pages.StockMananger" meta:resourcekey="PageResource1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    <telerik:RadGrid ID="RadStockGrid" runat="server" AllowFilteringByColumn="True" DataSourceID="GroupCitiesEds"
        AllowPaging="True" AllowSorting="True" GridLines="None" ShowGroupPanel="True"
         AllowAutomaticInserts="True" 
        AllowAutomaticUpdates="True" AllowAutomaticDeletes="True"
        ShowFooter="True" ShowStatusBar="True" 
        meta:resourcekey="RadStockGridResource1">
        <ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True">
            <Selecting AllowRowSelect="True" />
            <Scrolling AllowScroll="True" UseStaticHeaders="True" />
        </ClientSettings>
        <MasterTableView AutoGenerateColumns="False" DataKeyNames="StockID" DataSourceID="GroupCitiesEds"
            ShowHeader="true" ShowHeadersWhenNoRecords="true" AllowAutomaticInserts="true"
            CommandItemDisplay="TopAndBottom">
            <%--<MasterTableView ShowFooter="false" DataKeyNames="ProductID" EditMode="InPlace" CommandItemDisplay="TopAndBottom">--%>
            <CommandItemSettings ShowAddNewRecordButton="true" ShowRefreshButton="true">
                <%--ExportToPdfText="Export to Pdf">--%></CommandItemSettings>
            <RowIndicatorColumn>
                <HeaderStyle Width="20px"></HeaderStyle>
            </RowIndicatorColumn>
            <ExpandCollapseColumn>
                <HeaderStyle Width="20px"></HeaderStyle>
            </ExpandCollapseColumn>
            <Columns>
                <telerik:GridBoundColumn DataField="StockID" DataType="System.Int64" HeaderText="StockID"
                    ReadOnly="True" SortExpression="StockID" UniqueName="StockID" 
                    meta:resourcekey="GridBoundColumnResource1">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Name" HeaderText="Name" SortExpression="Name"
                    UniqueName="Name" meta:resourcekey="GridBoundColumnResource2">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Country.Name" HeaderText="Country" SortExpression="CountryID"
                    UniqueName="CountryID" meta:resourcekey="GridBoundColumnResource3">
                </telerik:GridBoundColumn>
                <telerik:GridEditCommandColumn ButtonType="ImageButton" 
                    UniqueName="EditCommandColumn" 
                    meta:resourcekey="GridEditCommandColumnResource1">
                    <ItemStyle CssClass="MyImageButton"></ItemStyle>
                </telerik:GridEditCommandColumn>
                <telerik:GridButtonColumn ConfirmText="Delete this product?" ConfirmDialogType="RadWindow"
                    ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                    UniqueName="DeleteColumn" meta:resourcekey="GridButtonColumnResource1">
                    <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton"></ItemStyle>
                </telerik:GridButtonColumn>
            </Columns>
            <EditFormSettings EditFormType="Template">
                <EditColumn UniqueName="EditCommandColumn1">
                </EditColumn>
                <FormTemplate>
                    <table id="Table2" style="border-collapse: collapse; padding-left: 20">
                        <tr class="EditFormHeader" style="height: 30px">
                            <td style="font-size: small" class="2" colspan="2">
                                <b>
                                    <asp:Label runat="server" ID="lbstockdetails" Text="Stock Details" 
                                    meta:resourcekey="lbstockdetailsResource1"></asp:Label></b>
                            </td>
                        </tr>
                        <tr style="height: 30px">
                            <td class="titlename">
                                <asp:Label runat="server" ID="lbName" Text="Name:" 
                                    meta:resourcekey="lbNameResource1"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadTextBox CssClass="radtextbox" ID="RadTextBox1" runat="server" 
                                    Text='<%# Bind("Name") %>' LabelCssClass="" 
                                    meta:resourcekey="RadTextBox1Resource1">
                                </telerik:RadTextBox>
                                <asp:RequiredFieldValidator ID="TextBoxRequiredFieldValidator" runat="server" Display="Dynamic"
                                    ControlToValidate="RadTextBox1" ErrorMessage="Enter name!" 
                                    meta:resourcekey="TextBoxRequiredFieldValidatorResource1"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr style="height: 30px">
                            <td class="titlename">
                                <asp:Label runat="server" ID="lbCountryID" Text="CountryID:" 
                                    meta:resourcekey="lbCountryIDResource1"></asp:Label>
                            </td>
                            <td style="width: 30">
                                <telerik:RadComboBox CssClass="rancombox" runat="server" ID="RadComboBox2" DataTextField="Name"
                                    DataValueField="CountryID" DataSourceID="GroupCountryEds" SelectedValue='<%# Bind("CountryID") %>'
                                    AutoPostBack="True" EnableLoadOnDemand="True" 
                                    meta:resourcekey="RadComboBox2Resource1">
                                    <HeaderTemplate>
                                        <ul>
                                            <li style="list-style-type: none" class="col1"><asp:Label runat="server" 
                                                    ID="lbCompany" Text="Company" meta:resourcekey="lbCompanyResource1"></asp:Label></li>
                                        </ul>
                                    </HeaderTemplate>
                                </telerik:RadComboBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="padding-bottom: 10; padding-top: 10" colspan="2">
                                <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                    runat="server" 
                                    CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' 
                                    meta:resourcekey="btnUpdateResource1">
                                </asp:Button>&nbsp;
                                <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
                                    CommandName="Cancel" meta:resourcekey="btnCancelResource1"></asp:Button>
                            </td>
                        </tr>
                    </table>
                </FormTemplate>
            </EditFormSettings>
        </MasterTableView>
        <%--<HeaderContextMenu EnableImageSprites="True" CssClass="GridContextMenu GridContextMenu_Default">
        </HeaderContextMenu>--%>
        <HeaderContextMenu EnableImageSprites="True" CssClass="GridContextMenu GridContextMenu_Office2007">
        </HeaderContextMenu>
    </telerik:RadGrid>
    <asp:EntityDataSource ID="GroupCitiesEds" runat="server" ConnectionString="name=MLMDataContext"
        DefaultContainerName="MLMDataContext" EnableDelete="True" EnableFlattening="False"
        EnableInsert="True" EnableUpdate="True" EntitySetName="Stocks" EntityTypeFilter="Stock"
        Include="Country" Select="">
    </asp:EntityDataSource>
    <asp:EntityDataSource ID="GroupCountryEds" runat="server" ConnectionString="name=MLMDataContext"
        DefaultContainerName="MLMDataContext" EnableFlattening="False" EntitySetName="Countries"
        EntityTypeFilter="Country" Select="it.[CountryID], it.[Name]">
    </asp:EntityDataSource>
</asp:Content>
